package com.huawei.crm.domain;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.HashMap;
import java.util.Map;

@EqualsAndHashCode(callSuper = true)
@Data
@TableName("systemdictionaryitem")
public class Systemdictionaryitem extends BaseEntity{

    @TableId(type = IdType.AUTO)
    private Long id;

    private Systemdictionary parent;

    private String title;

    private Integer sequence;

    public String getJson(){
        Map<String, Object> map = new HashMap<>();
        map.put("id",id);
        map.put("title",title);
        map.put("sequence",sequence);
        map.put("parentId",parent.getId());
        map.put("parentTitle",parent.getTitle());
        return JSON.toJSONString(map);
    }

}